import { createStore, combineReducers } from 'redux'
import { counter, user } from './reducers'

/* combineReducers({
  counter: counter, // key 是任意的，value 表示 reducer
  user: user,
}) */

// !#4 合并 reducer 的，返回合并之后的 reducer
const rootReducer = combineReducers({
  counter, // key 是任意的，value 表示 reducer
  user,
})

// 参数：传递一个 reducer
// 返回值：store 实例
export default createStore(rootReducer)